package com.lc.demo.controllers;

import com.lc.demo.common.bo.AddUserBO;
import com.lc.demo.common.vo.UserVO;
import com.lc.demo.model.Users;
import com.lc.demo.repository.UsersRepository;
import com.lc.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
public class UserController {

    @Autowired
    public UserService userService;

    @RequestMapping("/get_users")
    public List<UserVO> getUsers() {
        return this.userService.getUsers();
    }

    @PostMapping("/add_name")
    public Boolean addName(@RequestBody AddUserBO addUserBO) {
        return userService.addUser(addUserBO);
    }
}
